import react,{Component} from "react";
import MessageList from "../messageList";


export default class ChatScreen extends Component {
    // pastChattings: a list of {id,time,message}
    render(){
        const {pastChattings}=this.props;
        console.log("In ChatScreen, the Chatting messages: ",pastChattings)
        return(
                <ul className="messagelist" style={{backgroundColor:"red"}}>
                    {
                        pastChattings.map(perchat=>{
                        return <MessageList key={perchat[0]+perchat[1]+perchat[2]+perchat[3]} {...perchat} />
                    })
                    }
                </ul>
        )
    }
}



